<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>
<%@page import="com.situ.personal.entity.StudentNoHave"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>




	<!-- 3.多条件判断  if--else  if--else if--else -->
	<!-- 
	<c:choose>
		<c:when test="${表达式}"></c:when>
		<c:when test="${表达式}"></c:when>
		<c:when test="${表达式}"></c:when>
		<c:otherwise></c:otherwise>
	</c:choose>
	 -->
	<c:set var="score" value="90"></c:set>
	<c:choose>
		<c:when test="${score>=90 && score<=100 }">
		优秀
		</c:when>
		<c:when test="${score>=80 && score<90 }">
		良好
		</c:when>
		<c:when test="${score>=70 && score<80 }">
		一般
		</c:when>
		<c:when test="${score>=60 && score<70 }">
		及格
		</c:when>
		<c:otherwise>
		不及格
		</c:otherwise>
	</c:choose>
	
	<!-- 
	3.遍历集合 
		1.List<String>
		2.List<Student>
		3.Map<String,String>	Map<String,Student>
	-->
	<c:forEach begin="0" end="5" var="i">
	${i}<br>
	</c:forEach>
	
	<!-- 每次递增2  0-2-4-6  -->
	<c:forEach begin="0" end="5" var="i" step="2">
	${i}<br>
	</c:forEach>
	
	<!-- 3.1List<String> -->
	<%
		List<String> strList = new ArrayList();
		strList.add("张三1");
		strList.add("张三2");
		strList.add("张三3");
		request.setAttribute("strList", strList);
	%>
	<c:forEach items="${strList}" var="str">
		${str}<br>
	</c:forEach>
	
	<!-- 3.2 List<Student> -->
	<%
		List<StudentNoHave> list = new ArrayList();
		StudentNoHave stu1 = new StudentNoHave(30,"yaheihei");
		StudentNoHave stu2 = new StudentNoHave(22,"lalalal");
		list.add(stu1);
		list.add(stu2);
		application.setAttribute("list", list);
	%>
	<c:forEach items="${list}" var="stu">
		${stu.name}--${stu.age}<br>
	</c:forEach>
	
	<!-- 3.Map<String,String> -->
	<%
		Map<String,String> map = new HashMap<String,String>();
		map.put("cn","中国");
		map.put("us","美国");
		request.setAttribute("map", map);
	%>
	<c:forEach items="${map}" var="entry">
		${entry.key}--${entry.value}<br>
	</c:forEach>
	
	<!-- 3.Map<String,Student> -->
<%
	StudentNoHave stu3 = new StudentNoHave(30,"yaheihei");
	StudentNoHave stu4 = new StudentNoHave(22,"lalalal");;
	Map<String,String> map2 = new HashMap();
		map2.put("uk","英国");
		map2.put("gr","德国");
		request.setAttribute("map", map);
	%>
	
</body>
</html>